package com.hspedu.tankgame03;

import javax.swing.*;

/**
 * @Author Stringzhua
 * @Date 2024/3/14 19:34
 * description:
 */
public class HspTankGame03 extends JFrame {
    //定义MyPanel
    MyPanel mp = null;

    public static void main(String[] args) {
        HspTankGame03 hspTankGame01 = new HspTankGame03();

    }

    public HspTankGame03() {
        mp = new MyPanel();
        //将mp放入到Thread,并启动
        Thread thread = new Thread(mp);
        thread.start();
        this.add(mp);//把面板(就是游戏 绘图区域)
        this.setSize(1000, 750);
        this.addKeyListener(mp);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);
    }
}
